package com.egame.manage.biz.web.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.egame.manage.biz.utils.ConstVar;
import com.lenovo.manager.business.domain.UserBean;

import cn.egame.common.servlet.WebUtils;

public class BaseController {
	public int appId;
	public long loginUserId;
	
	public int getAppId() {
		return appId;
	}
	public void setAppId(int appId) {
		this.appId = appId;
	}
	public long getLoginUserId() {
		return loginUserId;
	}
	public void setLoginUserId(long loginUserId) {
		this.loginUserId = loginUserId;
	}
	
	public BaseController(HttpServletRequest req, HttpServletResponse resp) {
		appId = WebUtils.getInt(req, "gid", 0);
		if(req.getSession().getAttribute(ConstVar.USER_SESSION_KEY) != null){
			UserBean userBean = (UserBean) req.getSession().getAttribute(ConstVar.USER_SESSION_KEY);
			loginUserId = userBean.getOperatorId();
		}		
	}
	
	public BaseController(){		
	}
	
}
